import vue from '@vitejs/plugin-vue'
import path from 'path'

export default {
    plugins: [vue()],
    ssr: false,
    https: false,
    debug: true,
    resolve: {
        alias: {
            '@': path.join(__dirname, 'src')
        },
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://127.0.0.1:9000/admin',
                changeOrigin: true,
                secure: false,
                ws: true,
                cookiePathRewrite: {['/admin']: '/'},
                rewrite: (path: string) => path.replace(/^\/api/, '')
            }
        },
    },
    optimizeDeps: {
        include: [
            // "moment",
            // "echarts",
            "axios",
            // "mockjs"
        ]
    },
}